{% extends "base5050.html" %}
{% load humanize %}

{% block title %}Homepage{% endblock %}

{% block lcontent %}
	{{ profile.chrome_header }}
	</h1>
	<p>{{ user.get_profile.about|linebreaks }}</p>
	{{ pages_header }}
	{{ pagetree }}

	<br/>
	{% if versions %}
		<h1>Recent Updates by {{ user.get_short_name }}</h1>
		<ul>
		{% for version in versions %}
			<li><a href="{{ version.get_absolute_url }}">{{ version.pickle_field.title }}</a> on {{ version.created|naturalday }}</a></li>
		{% endfor %}
		</ul>
	{% endif %}


{% endblock %}

{% block rcontent %}

<h1>Groups<span class="bd-header-link"> <a href="/group/">view all</a></span></h1>
<ul>
	{% for membership in groups %}
		<li><a href="{{ membership.group.get_absolute_url }}">{{ membership.group }}</a>
	{% empty %}
		<li>No group memberships
	{% endfor %}
</ul>
<br/>

{% if comments %}
<h1>Comments on {{ user.get_short_name }}'s Pages</h1>
<ul>
	{% for comment in comments %}
		<li><b><a href="{{ comment.get_absolute_url }}">{{ comment.content_object.title }}</a></b>
			{{ comment.submit_date|naturalday }}
			by <a href="{{ comment.user.get_absolute_url }}">{{ comment.user.get_full_name }}</a>
			<p>{{ comment.comment|linebreaks|truncatewords:5 }}</p>
		</li>
	{% endfor %}
</ul>
<br/>
{% endif %}

{% endblock %}
